require_relative 'player'
require_relative 'poker'
require_relative 'observer_analyzer'

class Casino

  def initialize
    @observer_analyser = ObserverAnalyzer.new
  end

  def open
    players = [Player.new("John"), Player.new("Mary"), Player.new("Luke"), Player.new("Eimear")]
    poker_game = Poker.new 132, players, 1
    poker_game.add_observer  do |result|
      @observer_analyser.update result
    end
    poker_game.play

    players = [Player.new("Kamil"), Player.new("Maciek"), Player.new("Tomek"), Player.new("Lukasz")]
    poker_game2 = Poker.new 215, players, 2
    poker_game2.add_observer  do |result|
      @observer_analyser.update result
    end
    poker_game2.play

    players = [Player.new("Niall"), Player.new("Alexander")]
    poker_game3 = Poker.new 1231, players, 3
    poker_game3.add_observer  do |result|
      @observer_analyser.update result
    end
    poker_game3.play

    players = [Player.new("Liam"), Player.new("Ray"), Player.new("Ruhry"), Player.new("Joe"), Player.new("Donnacha"), Player.new("Pat")]
    poker_game4 = Poker.new 2452, players, 4
    poker_game4.add_observer  do |result|
      @observer_analyser.update result
    end
    poker_game4.play

    @observer_analyser.analyse

  end
end

cas = Casino.new.open